#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 1e4 + 5;
using pss = pair<string, string>;
int n, m;
vector<string> words[N];
void solve() {
  rep(i, 0, m - 1) rep(j, i + 1, m - 1) {
    map<pss, int> mp;
    rep(k, 1, n) {
      pss now(words[k][i], words[k][j]);
      if (mp.count(now)) {
        int r1 = mp[now];
        int r2 = k;
        int c1 = i, c2 = j;
        cout << "NO" << endl;
        cout << r1 << ' ' << r2 << endl;
        cout << c1 + 1 << ' ' << c2 + 1 << endl;
        return;
      } else
        mp[now] = k;
    }
  }
  cout << "YES" << endl;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  // freopen("1.txt", "r", stdin);
  // freopen("2.txt", "w", stdout);
  while (cin >> n >> m) {
    string line;
    getline(cin, line);
    rep(i, 1, n) {
      words[i].clear();
      getline(cin, line);
      int l = 0;
      for (int r = 0; r < line.size(); r++) {
        if (line[r] == ',') {
          words[i].push_back(line.substr(l, r - l)), l = r + 1;
        }
      }
      if (l < line.size()) words[i].push_back(line.substr(l));
    }
    solve();
  }
  return 0;
}